package com.atguigu.eduorder.enums;

/**
 * @Author panghl
 * @Date 2021/2/22 14:16
 * @Version 1.0
 * @Description TODO
 **/
public enum PayType {

    WXPay(1,"微信"),ALIPAY(2,"支付宝");

    PayType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    private Integer value;
    private String name;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public static String getNameByKey(Integer key){
        for (PayType vo: PayType.values()){
            if (vo.getValue().equals(key)){
                return vo.getName();
            }
        }
        return null;
    }
}
